<?php

namespace App\Providers;

use App\Models\Banner;
use App\Models\Image;
use App\Models\ImageCategory;
use App\Models\Project;
use App\Models\Sys;
use App\Observers\BannerObserver;
use App\Observers\ImageCategoryObverser;
use App\Observers\ImageObserver;
use App\Observers\ProjectObserver;
use App\Observers\SysConfigObserver;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;

class EventServiceProvider extends ServiceProvider
{
    /**
     * The event listener mappings for the application.
     *
     * @var array
     */
    protected $listen = [
        Registered::class => [
            SendEmailVerificationNotification::class,
        ],
    ];

    protected $subscribe = [
       // ImageEventSubscriber::class
    ];

    /**
     * Register any events for your application.
     *
     * @return void
     */
    public function boot()
    {
        parent::boot();
        ImageCategory::observe(ImageCategoryObverser::class);//图片分类模型事件
        Image::observe(ImageObserver::class);//图片模型事件
        Sys::observe(SysConfigObserver::class);
        Banner::observe(BannerObserver::class);
        Project::observe(ProjectObserver::class);

    }
}
